#ifndef GABORUTIL_H
#define GABORUTIL_H
#include <cv.h>
#include <cvaux.h>
#include <highgui.h>
#include <stdlib.h>
#include <math.h>

#ifndef PI
#define PI 3.141592653589793
#endif
#define e 2.71828

using namespace cv;
using namespace std;

class GaborUtility
{
	public:
	static Mat_<double>** computeFeatures(IplImage*);

	private:
	static int k;
	static void creat_kernel(double orientation, double freq, double Sigma, Mat_<float> &Real, Mat_<float> &Imag, long& lWidth);
        static double impulseReponse(int x, int y, double orientation, const Mat_<float>& src);
        static double conv(const Mat_<float>& kernel, const Mat_<float>& src, int x, int y, int anchorX, int anchorY);
	static double gradientX(IplImage *img, int x, int y);
	static double gradientY(IplImage *img, int x, int y);
	static double gxy(IplImage *img, int x, int y);
	static double gyy(IplImage *img, int x, int y);
	static double gxx(IplImage *img, int x, int y);
	static double getAngle(IplImage *img, int x, int y);
	static vector<double> computePixel(IplImage *img, int x1, int y1);
};
#endif
